Comments and minor code cleanup