Merge Sue's fix for the session refcount with mine, simplify.