Fixed a DEBUG mode bug in worker.c