Changed to use new MIN_MAX_REWIND. Also lots of debug fprintfs that must
be removed.