fixed save and reload, misc cleanup