Minor tweak to improve compiler output. Cache values that are looked up from globals in a local so the compiler can put them in a register.