Various 64-bit fixes