Adding mongodb and some fixes