make do_autosave safer with two save slots

also, misc. exception handling and assertion cleanups