Ties the calculation into the close session table. pcbiggs
Fixes out of bounds exception. pcbiggs