Try to fix the exception of Frame.energy()
Merge pull request #4 from benlau/master

Fix of issue #3