Fix parsing of ansi color codes that span flushes
Fix incorrect CSI command name in debug output
Stylistic tweaks in charset conversion code