Fix undefined program issue. #1370