Fix error 500 in documents.