Fixed a memory leak in query building