Fixed to work with newer toolchain