Fixing models deleting themselves because of bad refs.