Fixed exception handling after function calls.