Fixed userid <-> entity matching.

If you find bugs, please report them.