Correct encoding errors