Fixes charset issue and removes rewriting function.