fix last line offset (closes #29)