fixed segfaults (session deletion, channel deletion)