Fixed some errors in examples, thanks to ChristosT