Some modifications to support Mongo Refererences, DateTime etc.