Fix traversing bug for last element in .position()