Implement exception handling in pipeline factory
More testing improvements