Fixed py3k compatibility
Added memcpy