Bug fixes on examples