iterateInside not checking empty length at the right spot. fetchPositions off by one error looking up pos.