Remove history files and improve robustness of update script.