Added debugMode and drop tables when debugging
Merged with upstream
Fixed resolution of debugMode flag