Cherry-picked ORM bugfix for a notice