small optimizations

Replaced (x * 8) with (x << 3).