g: cleanup session.c
g: more cleanup