Added support to check for optional dependencies.