Fixed runtime errors
Updated example