Applied #159 to the renderSync method

Fixes #182
Merge pull request #183 from LaurentGoderre/fix-182

Applied #159 to the renderSync method