Fix API of example code

This briefly tripped me up.