Fix object references (still does the reference checks later in the code)