Prevent invalid MongoId instances from being created.