Fixed internal off-by-one error.