Fixed alignment error
Simplified C code to only deal with memcpy