Fixed bug in history; current value stored instead of previous value.