Improvements to the window title and quitting function