Fix of the invalidLoop fix.
Tests (Runnable first link invalid loop detection not implemented yet)