fix items counting bugs caused by wrong itemPtn and match mode.