Don't use replace to swap in code with dollars in it, fix #587.
Merge pull request #598 from remy/fix/bling-bling-587

Don't use replace to swap in code with dollars in it, fix #587.