Fix bug in reset.