Fixed some bugs on setup.sh and MAC