Bug-fix in item_factory