Corrected an off-by-one error.