Fix issue with null relationships