Fix the bpm encoder