merge of #2893 polyglot/regression/2774 fix