Improve compatibility checking