Corrected encode