Cleanups, fixes and formatting.