Hi Steve,
in case you missed it, you might want to have a look at my Nov 25th patch. Your proposed fix very much sound like what I did there, so that might save you some work.
regards
Moritz