phi-merging memory fixes