Corrected error in error handling in getLinkIndex, getJunctionIndex