Merge recent fixes and cleanups.