Fixes to gui (reload editing etc) and warning on exit with unsaved changes.