Upstream fixes