Refix dummy encoding to automatically relabel classes if necessary
Style and performance