Fix a bug when replacing $ to _