Support OSX
Fix 64bit warning