manual merge of #303