Move toCBuffer3 into visitWithMask
Replace infinite recursion bug with assert