line-based API fix for #211
Merge pull request #212 from fnl/master

line-based API fix for #211