Fix Key-Value pair packing
1. Fix type packing
2. Fix key-value/value packing unpacking
3. Fix packing initialization