Fixed some mistakes in encoder module