Fix negative energy buffer issue