Implemented prettier application exiting, and some minor changes