bugfix in debug mode and fix regression in make distclean