Added a test in pos2Idx for outside value