Fixed bug where the server would connect to the wrong database