Replaced NSSet in favor to NSArray in the construction of queries, NSSet...

... not always have the same order .