test factory (broken)
fixed test factory, added more tests
Merge branch 'factory'
fixed tests