Close remaining pipes if some are missing
Add tests for closing pipes