Some debug fixes.