Fixes MongoDB connection.