Properly handle blank line at beginning of input.

Closes #882.