Encoder bug fixes. * Fix forward declaration mismatch. * Fix division by zero in 64X test. * Avoid shadowing of variables in encoder.