Add debugging information to mongo connection.
Add test for port ommission.