Bug fixes and working examples