Fix issue #1104 - regression issue with %%name%% variable

My fingers are itching to rewrite this whole function as it seems to be causing more and more issues. Will do when I have the time, which unfortunately probably won't be all that soon.
Merge branch 'master' of git://github.com/Yoast/wordpress-seo into Issue-1104-regression-in-var-replacements
Merge pull request #1108 from jrfnl/Issue-1104-regression-in-var-replacements

Fix issue #1104 - regression issue with %%name%% variable