Miscellaneous code cleanup.