Fix cursor offset off-by-one

References #27.