fix unpack repeated bytes