You may have to use $prepared[fieldx] instead of $userinfo.
I actually tried it and in this particular template (and maybe others), you need to use $userinfo[fieldx]. However, it could be in other profile templates, you need to use $prepared[fieldx] as you suggested.