Cleanup: use memcpy instead of for loop.