Corrected some issues with sessions