fix keysToReduce must be the same for all levels

Refactoring seems to have removed this logic