Fix a possible crash with active link range out of bounds