Fixes following latest upstream changes