Fixed a bug on do_fork().