Fix example and prevent leak FDs