Fix for #32 (at least for piping to succesive transforms, error and close problem is not handled)