Fixed NDEBUG/DEBUG inconsistecy

asserts is on if NDEBUG is not defined, but it refers
to functions which were declared if DEBUG is defined.