adding a null check
adding a call to set an itemstack's amount to 0 (fixes #148)