Fixed some error when generating items.