Fixed encoding on save