Fix bug 1761: support entities in relations for backwards compatibility