Text editor fixes