Integrated min2phase fixes & fixed threading bug in ScrambleTest.