Fix database type handling.