merged 38, 39 pull requests from upstream