Change handling for protocol for links.
Cleanup a bit.