Fix a deriving bug, arising from recent refactoring