Check linkData keys to avoid KeyError

fixes #693 on github.