Fixed submission script bugs