Mark -- I wanted to give you an update. My friend figured out that the problem had to do with Mac's Linux line endings, versus Windows's line endings (the latter which your script is written for). This is where my "phantom" spaces were coming from. He tweaked a few things in your code to convert Linux line endings to Windows, and it's working great. I think he's forking your code on github and sending you a pull request. Thanks again!