Bug fix: set a lower bound on remaining length.