Fixes #257. Incorrect replacing in script inlining.