Cleaned up xi2_device_check_matrix() slightly.