Fixed incorrect determination of pallet number