Fixed some issues with pipe. fixes #13