Testing clustering and fixing bugs