Fixed segmentation fault in the 64 bit build. Thnks to aend & derVedro