Try and remove a few more bash-isms from the script.