Clean up incorrect code and add some examples.