Fixed shell scripts to have more universal compatibility.