Add a test for @AutoFactory on constructors and fix issues uncovered by the test.