copy: replace NULL with null
copy: simplify the bulding of the result in normalizeObject()