Correcting bugs in examples

Correcting all the bugs that examples have