A fix, but it will probably only catch the most obvious examples of loop
linking.