fix stack overflow issues
Merge branch 'master' into gh-pages
fixed stack issues