Be a bit more resilient about messy databases