Some fixes and cleanups and examples added