Massive update from upstream. Thanks!