fix for countInner() and iterateInner()