Clean up prepopulate/filter link creation. Fixes #1665