Fixed NPE when logging in to server