Mongo provider test

tests for mongo provider + repaired minor bugs found.