Finally got signal handling working.