Exception handling improvements