Formatting fixes, code cleanup