Bug fixes before the 3.1 release