Fixed #172 so the "onSessionEnd" event fires and passes arguments through correctly.