Cleanup and formatting fixes