orm: Implement proper NULLing of relationships