Upstream fixes

Fixes issues introduced by upstream changes