Removed global parent variable from example. Fixes #3903.