Added an additional check to see if object has property 'relations'. 

Fixes #37