Optimizing piping for common case, fixing memory error in generic piping case.