Exception handling rewrite.
Export exceptions.
Fixing tests.