Fix #390

Please review my comment in #390 as well; not sure why it wasn't done this seemingly simpler way in the first place. I'd love it if we could throw this ugly loop away altogether, however I suspect the crazy inexplicable issue it worked around in the first place will be too hard to track down / reproduce / prove fixed. This change seems fairly safe for now?