Fixed an off-by-one bug at end of line.