Making some memcpy optimizations