Minor clean ups

- simplify debug code
- rename limit -> semaphore
- simplify globbing code use a better regex