Fix a bug in key creation related to our use of custom MongoIds.