Make inline functions static and optional WITH_DEBUG=no
DEBUG: better handling