Added --root argument

This is the latest version of the patch, rebased on latest master.