Fix fatal upgrading from 3.1 to 3.2 in some cases