Fix some encoding stuff