Fix unfold for third order pruning