Set object type at object creation time, not object parse time.

Otherwise we can have objects without a type, which is not good.
2 files changed