Fixing bad example code