Better handling of shutdown state, forwarding of stderr on failure, etc.