Last version of encoding fix