Re-committing r228628 with a fix for 64-bit builds.