Update encoder and tests