Fix infinite recursion for cyclic deps (#13)

This is fixes the issue that I reported in #13.