Fix folding bug

Resolve: #1