Fix to prevent bad entries from being stored to Mongo