Changed some factory code.
Made a couple of more tests.
Fixed some layout.