Only remove `root` when needed.

Should fix #8.