Fix an off-by-one if the command string being split does not have trailing white space or ';'.
Drop empty commands at the earliest opportunity.