Fix trace buffer problem of records not properly deleted after analysis