Fix query service tests