Add missing variable declarations in example code