Fix links for associated records.

Fixes #3941