64 bit fixes patch