Miscellaneous cleanup and formatting