Fixed bugs and improved examples