Review code to merge in master

There is some changes in setup.sh.
Fixed break issues inside switch cases.