fix compile issues in #DEBUG code