Added error code for user not being logged in when expected to be.