Fixed memcpy usage