Do major-mode checks with derived-mode-p instead of eq