fix a small bug in the unpack code