Modified entity item-handling functions to deal with item counts.