Improves exception handling.