Some compatibility fixes