Fixed bug in finding nearest cluster