Cosmetic cleanup

Cosmetic changes to comments and some functions.