fix some 64bit compile issues