fixes issue #36: error on deleting old sessions
fixes issue #41: fixed restore
Merge remote-tracking branch 'origin/issue_36'