Fix infinite recursions in repr_func