fixes to energyerror
merge conflicts