Fix issues with character sets (hackily)