Misc compatibility fixes