Fixed #778

Implemented new autosaving infrastructure