Cleaning code related to root + small bug fix