Added parse error handling.

Solves #18