Fix mergeing of environment phases