Fixes to match upstream changes