Fixed signal handler to properly catch SIGCHLD. And moved waitpid to just the handler. Currently there's an issue where a process will get backgrounded, and the SIGCHLD will get ignored.