Fix code which doesn't compile on windows 64-bitg