fix recursion error.

https://typescript.codeplex.com/workitem/2519