Merge components into a struct vector
Fix bugs