Fixed bugs. Added examples.