Fix issue with path detection