Prevent NullPointerException for logged out users.

Resolves issue #135.