Fixed reset function