Make CreateElement comply with the spec.