LineParser: Add test, fix bugs