Only remove `root` when needed.
Merge pull request #18 from XhmikosR/issue8

Only remove `root` when needed.