Use expr.func instead of expr.__class__ in expand