fix w>=3 in ScalarEnc