Updated to check return value of waitpid()