Fix issues for 3.1 release and sync -x v3.3 rc0