Fix 64 bit probs
Fixes for 64 bit