Are you finding that you can't remove openid's from your account?
Because it works for me. What version of php are you using?
intval is correct - it wants an integer number from the string (or zero) - strval would be a string, but maybe $user->openid is not being stored as an array in integers like I am expecting?
The session clearing is a valid point, I added the sessions as a last minute compromise to get the new account registration finally finished and it's not polished at all.
