merged from upstream#master