fixing bugs in query operators and in random collection test