Fixed a bug, optimised dbscan a bit.