Fix segfault by fixing getsignal condition.