Fix bug in ZTrace