Would it make sense for these functions to close their argument stream? Right now, they just call shutdown.