Checked some compatibility issues and tweaked example.