Fixed delta collisions

Erroneous values were reported when running the same script multiple
times on the same server. This was due to the values only being stored
once per script and then used to calculate deltas for another instance
of the script.
Cast args to avoid conflicting types
Merge remote-tracking branch 'origin/master'