various small changes for 64 bit, trying to sort out problems with float to integer conversion.