64 bit build

Fixed datastructures for 64 bit build (esp. type long)