Made THREAD_LIMIT a global and fixed some log msgs.