Fixes infinite loop in dependency checker in some cases