Rollback and fixes to encode and settings