Fix IE8 variable hoisting of apply function in  if/else.
Merge pull request #213 from frekw/master

Fix IE8 variable hoisting of apply function in  if/else.