Even more fixes and cleanups.
Yet even more fixes and cleanups.