manually merged upstream commits from Aug 27, 2014