Make the schema replacement more tolerant of trailing spaces