Fix and simplify user id parsing