Added support for loading local documents.