Fixed a bug that could potentially cause LJ energy to be nan