Re-wrote do_waitpid from scratch. Only test0 passes now