Fix exception caused by invalid ItemStacks