Nested dependencies fix

Adding nested dependency check