Use the right kinds on the LHS in 'deriving' clauses

This patch fixes Trac #9359