Fix Trac #2701: make deriving check better for unlifted args