Add check for invalid traces.