Integrated and cleaned up several more fixes.