Few fixes to work with latest Mongoose