Bug fix in trace and new tools to save flags/barr