Added _DEBUG checks for debug messages