Fix handing of unusual characters