Fixed 64 bit compilation warnings and errors