Ah, I think I was still appending a new one each time, rather than replacing. That would explain it.