Even the formatting on your code makes me question mine.
Thank you both very much for your time and help. It must have been something in the function (which I refused to believe at the time as I've used it elsewhere). Getting it back to the stage it was at earlier was a pain (I must commit more often) but simply swapping out the function with this sane one did the trick. Resolved!