Fix an issue with type class instance ordering