Shim debug, making it optionnal

Let me know what you think of this. It makes debug an optional dependency.