Minor modifications and setting mongo connection.