Fixed issues with chossing the correct connection settings.