Improve examples

Also fix a bug in the Rechenberg optimizer.