BugFix for trace function.