Better handling of MongoDB empty port number.