Check for cyclic dependencies.