Fix bad handling of ratio queries with keywords.