[#708] Clean up code, fix comment, remove obvious comment
[#708] Add more tests to link detection tests