Fixed bug in session initialisation