Fix fold and build method in Component

hi.

I tried to fix #11.
Would you mind review this code?