Made corrections so script will execute on both Mac and Linux.