The reason I can think of why you were having specific problems with 6 is because it isn't a power of two. Having set up fencing brackets for tournaments this is definitely true for single elimination, but it might also be true for a round robin if you are essentially running it as a no elimination bracket. I bet you would have problems with 10, 12, 14, evens that aren't a power of two, and all n-1 of those numbers with your code.
Just an idea really, sort of fun to think about, maybe extremely useful for any tournament above 8 or so.