Backported @cdevienne jacomyal/sigma.js#185 fix