Fixes to hopefully handle unicode correctly.