Fixed a login bug when user closed out of the window; finished code review changes