Bug fix: Priority queue now correctly picks the k nearest neighbours.