fixed typo in cast_to_sum