Fix compile after upstream pull, clean up a bit