Fix bug in handling Session Keys