Fixed document editing issues