You could always select all the phalanx units and press 'f' '=' 'f' to lengthen the phalanx and get rid of any gaps.