manual merge from #982