Changed pipeline syntax to use ()
Added test cases for error handling