Changes made by Jonathan Winterbourn (jonwinterbourn@googlemail.com).
fix broken reset
Changes made by Jonathan Winterbourn (jonwinterbourn@googlemail.com).