Fixed error when applying invalid enchantments