Fixing null pointer when there is a missing root directory.