Fix npe in session

Possible fix for issue #10