Added clone() for deep-copying of queries.