Correct handling of anchor IDs