Crash/bug fixes and adding buttons to end application.
Merging what Pet wrote while I was fixing bugz