Added support for setting rootPrefix.