Examples and documentation. small bug fix and improvements