Fixed mongo connection code.