Added support for traversables in reset() and prev(); fixed indentation