ifndef around debug code and some debug info cleanup