Fix bug in reset