Lots of small fixes, bug in sampling, bugs in kde, also plotting rate of convergence for kde