Fixed DEBUG flag behavior