Fixed encoder ecca bug. Improved encoderMode