example source plus bug fix

Example program plus bug fix.