Fixed #725: NullPointerException in quoteReplacement