error handling, doc comments and more tests for filepipe