Fix buggy % escaping code. Save history on reload.