Fix exceptions

Closes #11