Replace type: object, but in the right places