Fix phi node handling in unrolling