Changed implementation of generate-guard-trace-key