Fix slot packing.
Fix slot id calculation.