Use hasOwnProperty to filter properties to copy