Minor optimizations (cf http://jsperf.com/sign-extension)