Properly handle merge stacks in equipment inventory

Fixes #1137