lalonde demo.
Various fixes including error checking.