Fix logic errors in handleWith and mapFailure

this may refer to a computation before it was executed and would lead to bizarre errors where a previously computed error appears to not have been computed yet