Fixed checks for db version.