merged with latest from upstream/master