fix some warnings and begin porting to 64bit