Fixed many bugs in TrackAnalysis