Fix reduce and in turn fix trim