Fix a minor bug in defer and exception handling.