fix recursion error.

https://typescript.codeplex.com/workitem/2519
Merge pull request #9 from sparecycles/stackerror

fix recursion error.