Minor cleanup, plus added docs.