Need to look at the side effects of having the identity in the preferences being NULL and fix any places where the code doesn't handle this case. Basically just look at all the places in the code where KIM looks up the identity in the preferences and make sure it handles NULL there. Once that has been verified just take this patch. Passing to Zhanna.