Add exceptions

Closes #1