Correcting off-by-one error.