Slight fix to session API