Fixed a bug in fwdloop.

Where incorrect cleanups will lead to infinite loops.
Changed to use throwIO instead.