Autosave crashfix

caused by 'div by 0' exception