Fix broken tests for Query model