Fix incorrect factory initialization.
Add delayed init test.
Merge pull request #5 from wichitacode/factory-fix

Factory fix