added tests and fixed some other getRootUrl validation issues