memory optimization and minor bug fix
Merge pull request #3714 from pozzobon/TrackTrigger_NP_20140506

memory optimization and minor bug fix