Two fixes: fix an off-by-one bug, and fix 32-bit builds on 64-bit systems.

Signed-off-by: Ingo Molnar <mingo@kernel.org>