Fixed boolean bugs, conditional p2 merging