Fix for rewinding history too far.

Make sure that history.removeLast can't go back too far.  This is a painless error check, and has actually happened to me in the wild by accident.