bug fix to the virial calculation