Handle optional dependencies.