CMS-2471 Improve query parser.