Fixed lots of errors, added auto-save