Compatibility changes for when merging upstream