compatibility fixes for 4.8 and 4.9 toolchains.