Made session events more efficient and mitigated the risk of memory leaks when failure occurs. This should also make the initial connection slightly more efficient.