Tests now passing again
Cleaned up the factory constructors. Fixed remaining type issues