bug: in case the bounds are crossed to start, it goes on a big loop
which takes a long time. Probably this should not happen normally,
but it can't hurt to guard against it.
Thanks to Joe Keane <jgk@jgk.org> for providing the fix.
git-svn-id: svn://10.0.0.236/trunk@12549 18797224-902f-48f8-a5cc-f745e15eee43