Bugfix: don't unlock root if not needed