Fixed bug where relatedRecord throws error if relation is null.
Spelling error