Fixed bug in processing Query references. Stubbed some tests for checking ids and priorities on update events.