Fix duplicate track bug when processing multiple files