Fix some bugs in type class instance desugaring