Fix to prevent error when $id is not a MongoId

Sometimes $id contains strings that are not Mongo IDs. Sometimes it contains "all", more often it contains things like "unBloc-1104". In those cases (may be something weak in MongoDB instanceof operator) the test triggers an error and the php process exits (it should instead generate a new Mongo instance and return it's Mongo ID)