Replace int with pid_t where applicable