Fixed bug of terminated child processes not being handled.