Bugfix on type of related