Few fixes for mongo support