Fixed bug in density debugging