Fixed 2 bugs

Flatten and Join updated to be more consistent & clean