Fix for encoding errors