Fixed the encoder tuning 'function'.