Bug fix on reading root