Corrected issue #304 (glass energy balance).
Merged master