Brought forward from 0.9.8 - 64 bit warning fixes and fussy compiler fixes.