Simplify exception handling, fix code coverage