Fixed reset function.