Fix encoding issue.
Better error messages