Fixed bug in reset().