Fix log_debug(), add some tests
Merge branch 'master' of https://github.com/fachat/XD2031