Fixes #348 by respecting the inventory stack limit
Merge pull request #519 from yueh/fix-348

Fixes #348 by respecting the inventory stack limit