BUG: fix tophat sampling in KDE