manual merge of #499