Fixed energy depletion and some other minor issues