Fix compile errors with newer toolchains