manual merge of #931