Fixed bug in QueryProcessor. Passed tests.