Guard against NPE (occurs if logout is called when no account exists)

This fixes more tests too.