Fix bug in query with MongoDB 2.4