Skip archiving an empty session
Fix logic with attempting to save session
Improve start/shutdown detection