Further auto-save improvements

Warns when there are unsaved changes and user wants to load a new file.
Also: cleaned up unused vars