Fix a problem when checking database type