More debug fixes