Fixed bug in delete. Tweaks to clustering