Fixed Exception handling.