Fixed setting of db version in upgrade checks.