Fix passing object of class type by value.