Fix total recalculation on clear