Hi Niamh,
I am sorry you ran into a bug with this script. We will likely go back to the C-based code for wig2bed in the upcoming v2.2 release, for this and for performance reasons.
In the meantime, would you be willing to post your bigwig and wig files somewhere where I can access them? I'd like to figure out where my script went wrong, and having a repeatable way to break it will help me find the cause.
If they are large files, Dropbox.com offers a free 2GB repository.
In any case, if you have time to offer those files, I'd be grateful.
Regards,
Alex