Cleanup and fixes.