In response to Coverity CID 383367 - it is perhaps false positive but there has been another small bug - the step should be length of to, not from (which may be longer). + written a test for it