Fix dependency cycles