Fix panic when in the root directory