Added some 64Bit portability fixes