Correcting an anchor to remove invalid character