fixed the _quater bug in encoder. No overflow now.