diff --git a/code/modules/cargo/order.dm b/code/modules/cargo/order.dm
index ef6484f21fc..66987b3f0a1 100644
--- a/code/modules/cargo/order.dm
+++ b/code/modules/cargo/order.dm
@@ -141,8 +141,12 @@
manifest_text += "Contents:
"
manifest_text += "
"
var/container_contents = list() // Associative list with the format (item_name = nÂș of occurrences, ...)
- for(var/atom/movable/AM in container.contents - manifest_paper)
- container_contents[AM.name]++
+ for(var/obj/item/stuff in container.contents - manifest_paper)
+ if(isstack(stuff))
+ var/obj/item/stack/thing = stuff
+ container_contents[thing.singular_name] += thing.amount
+ continue
+ container_contents[stuff.name]++
if((manifest_paper.errors & MANIFEST_ERROR_CONTENTS) && container_contents)
if(HAS_TRAIT(container, TRAIT_NO_MANIFEST_CONTENTS_ERROR))
manifest_paper.errors &= ~MANIFEST_ERROR_CONTENTS
@@ -150,7 +154,7 @@
for(var/iteration in 1 to rand(1, round(container.contents.len * 0.5))) // Remove anywhere from one to half of the items
var/missing_item = pick(container_contents)
container_contents[missing_item]--
- if(container_contents[missing_item] == 0) // To avoid 0s and negative values on the manifest
+ if(!container_contents[missing_item]) // To avoid 0s and negative values on the manifest
container_contents -= missing_item