#449: Bugfixes after merge

While the pull request #451 successfully merged into master, it was discovered by the issue author at the close that the merged version contains two bugs: missing single quote and using `sed` instead of `perl`.
The two bugs are fixed now. And this request is to merge them.