Fix password-authentication problem on db upgrades