Fix previous commit
Fix type unpacking
Fix range packing
Adapt smoking test to the new changes.