add 64 bit support and fix warnings