Handle stdin correctly.

- Fixes #2.