Error Handling in ComponentFactory

Closes #18