I went through nearly all of the scripts the past couple of days and it turns out that this particular fix (line #40) is likely relevant to quite a few of them, as this section of the code seems to be heavily copy-and-pasted among them (software maintainability issue - tsk tsk, Titus). I am probably going to factor this portion of the code out into a common module and will apply your fix within that context instead. So, I'm going to hold off on processing this PR for the time being. Thanks for submitting it though - it looks good prima facie.