Tweaks to pack/unpack functions.