Fixed a couple issues introduced in the energy error refactoring.