Potential StackOverflowException fix
Merge pull request #1449 from scottt732/StackOverflowFix

Potential StackOverflowException fix