Fixed terminate on failure for encoder