Fixing the document structure