Fix for exceptions in resumable function