Updated the examples: polishing and bug fixing.