Bugfix/exception handling

Resolves #46 and #45