Optimizations

Add a missing type guard that was possibly dipping performance very
slightly, and add in another Math.imul another fast path.