Improve text input

* Assume XYZ are first on a line; discard remaining parts of line
* Don't crash when there's zero points