more debug fixes