Add checks for window.DEBUG.enabled