Everything working.

The workaround will clear queues in main instead of in sighandler.