fix RS encoding errors