Fixed test harness function in encoder