Fixed shell script compatibility with non-bash Bourne shell derivates.