Added missing `var` statements.

There seem to be some `var` statements missing from `mapValueInRange`.