Graceful exit 32bit

re-submitting bill's PR with my fixes on top.
I've rebased his work and mine.

Closing his PR, to continue working on this one.