fixed errors resulting from a bad sed.