More legacy changes from upstream