Added support for custom library directories.