strict mode, fix accidental globals
convert hash key to int earlier