Add tests for error propagation
Simplify code for running transform pipeline