Tweaks to tracking code