fixes build and runtime errors which popped up after merging the latest latest upstream