Fix a leak #6f7e7a8
Extract constant variable DEBUG to ENV
Add test for initizlizing