Critical bugfix. Replaced encoder class with default() function