Clean up signal handling a bit.

Done