I've been coding at the wee hours and had the same sort of mistake. Indeed, I have done it after a restful night of sleep.

Sometimes you just got to get someone else to look at the code.

I did the vector thing because that was what was in my old example.