Made dependency sorting optional.