various compatibility fixes