Corrupt/incorrect data after restarting RPi

I restarted the RPi running EmonCMS the other day. Afterwards there was a very large negative value in the kWh reading (-328,439).

How can I correct this?

Should I have shut down the EmonTX3 first?
(What was the likely cause of the error(s)?)