fix trim-nested

cc @kumikoda fixes the lol bug.

cc @sh1mmer