Fixed ajax loading of documents.