Make addToRandomInventory type safe

Better, Faster, Stronger

Closes #877