Sum field of sensor.gas_consumed has odd jumps. How should I correct this?

I am using Home Assistant in a RPi and back in April I added slimmelezer to monitor my energy consumption. All worked and data has been collected since. However, I was looking back through the data and there are odd events that appear to be in the summing of the table data that I cannot explain. The data for two of the months include events that don’t just add the delta to the sum.
On 23 April the sum suddenly became the state value rather than the sum of the previous sum and the delta between the state and the previous state.


This can be seen in the table data.

a similar erroneous event occurred in June

This is the effect on the overview

But the current month looks ok

Can anyone explain what is going on?
Is it possible to correct this?