I had to read this a couple of times, but in the end it seems that unit testing wasn't in the cards and through some hard thinking he arrived at the bug fix he needed.