Fix bug in query creation