Add some missing housekeeping for pipe