Code cleanup

Some code cleanup and spcifying the path to roots .bashrc in case this
is run with sudo.