Improved query parser.