Fix processing escape codes