General cleanup, plus bug fixes in commenting.