Various smallish JIT optimizations

See the individual commits for details. Please don't push this quite yet; I haven't done much testing.
Isn't there a parenthesis to much here?