Some heavy changes to exception handling.