Fixing document structure