Changed query processor, which fixed some minor bugs