Added failure to error message when testing server connection
Removed nullpointer when exiting preferences and testing server configuration