Second commit. Some cleanup and repairs.