Corrected some issues with termination proving.

Finally finished the fix concerning the chain processor (also slightly improved the loop processor while I was at it)