CA-107636: Fixing bug in byte wrap code