Better handling of invalid link IDs