Fixed a few bugs amended examples