TODO items:
1.  Finer-grained error reporting
2.  Automated tests
