Debugged convert in document_converter so that it works well in chain-conversion.