Added reset function (resolves #2).