issue #21491: Fix orm.
Merge pull request #922 from jrogelstad/21491

issue #21491: Fix orm.