Fixing document behavior