Query evaluator unit tests and fixes