Make exception reason optional + add tests

Closes #9