64 bit support, fix warnings