Fix dependency ordering