Fixes Mongo-safe decoding