Fixed evaluate-apply

Hopefully...
Also added count-number-of-guard-traces function