Fix group() query logging so it uses 'key' instead of 'keys'