RootIsShared() - Fix array out of bounds error

This happened for me on the last (empty) line, but better safe than sorry
so we make the check general.