Fixed potential infinite loop in __checkDepencencies.