Properly handle packing list lengths
fix warnings