Minor cleanup, add documentation.