Patch Set 2: I would prefer that you didn't submit this; IP review completed

Thanks, that's much better than my quick-and-dirty patch... There are some whitespace problems with the test class, though.