Small improvements to text/html switch