Misc code cleanup.