fixed ushort pb in bin protocol
backport defect 49/52/53 from master