Raise an exception when a session is not set up properly. Included test case.
Raise an exception when a session is not set up properly. Included test case. Should resolve #7