Added trace support (minor changes to other files)