General cleanup

Miscellaneous minor code clean-up.
@laarmen Do you have any opinion about this?