Fix regression in selecting database.