Fixed #19632 -- Bug in code sample.

Thanks grossmanandy at bfusa com and Simon Charette.