Bug fixes and new examples

Bug fixes and new examples