Fixing double encoding