Added more verbose error handling

Closes #10.