Core: Fixed array size issue in HitCluster, also improved check for nearest neighbors line