Added location_copy() function and replaced equivalent uses of memcpy().