fix transposition of arguemnts in pipe() callback, do the simplest possible error checking