Some compatibility fixes.