update set_value for name and slug

Updated set_value('name', $name) and set_value('slug', $slug) 
to set_value('name', $sample->name) and set_value('slug', $sample->slug).

Otherwise the variables give a PHP error.
Merge pull request #8 from jensdeschrijver/patch-2

update set_value for name and slug