Clean up tests, make link presence checks more rugged