Fixed signal handling on exit.