Minor code cleanup in various places.