Updating to deal with changes required by MongoDB sharding

These changes have come into play with more recent versions of MongoDB