Fixed the example and did some cleanup.