Bug fixes and example update