Cleanups and fixes.