Improve user tests

Fixed a weird issue where a factory must be explicitly referenced
before it is created.