Only validate links if present.

Closes #533.