Fix submission script bugs