Improve error reporting for 'deriving'