Bugfix in query_many()