Fixes to get two-step linking working properly