Fix another crashing bug due to referring to data that has been deleted.