Added exit, wait pipe and stat