Fixing root path detection.