Fixed NPE in session code.