Merge pull request #503 from eric-wu/release-y

Improve the performance of isRoot() to constant time
Merge branch 'release-y' into develop