Fixed error in the recursive method for getting module dependencies