Modify root_dir handling in support of integration tests

@xeger