Added an exit-status catch on SSH if commands fail and chmod for new files