Fixed functions to correctly handle energyType=NA.