Encoder minor fixes