Tighten the user id assertion, and fix tests.