Fix an issue with mongo failing to recognize ObjectIDs in queries