Add debug output to keyword replacer