Assert type not null in relationships. Fix #117