Fixed the order in which phi nodes are created (was incorrect)
[#80895676]