Fix bug 1762: support entities in relations for backwards compatibility