Fix encoder and update docs