Fixed client session bugs