More energy calculation fixes.