Some cleanup work.
Cleaning up plugins when session is destroyed