Fix object references, and object types.