Some clean up, documentation, and style consistency.