Use user ID number instead of name
This helps to avoid issues with user names which contain space characters.
Close #3830.